﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CodeGame.Networking.Clientside;

namespace CodeGame.LuaLibary
{
    internal static class luaLib_game
    {

        private static bool isWorldInited = false;

        [LuaHelp("Loads the world")]
        public static void initWorld()
        {
            Singletons.States.SwitchState(new GameState());
            isWorldInited = true;
        }

        [LuaHelp("Makes a request to the server to download the world, it will show after")]
        public static void downloadMap()
        {
            if (!isWorldInited)
            {
                Singletons.Console.Print("World not Inited", Singletons.ErrorText);
            }
            Singletons.CurrentWorld.EmptyEntities();
            ClientProtocolWorld.SendWorldRequest();
        }
    }
}
